Skip to content

fix(ci): restore central review, security, snapshots, and hourly repair - #731

Closed
seonghobae wants to merge 38 commits into
mainfrom
fix/strix-python-security-cves
Closed

fix(ci): restore central review, security, snapshots, and hourly repair#731
seonghobae wants to merge 38 commits into
mainfrom
fix/strix-python-security-cves

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Problem

Five central defects form a control-plane deadlock or operating gap for dependency and security pull requests across the organization:

  1. CodeQL init/analyze and upload-sarif used different CodeQL Action revisions.
  2. The Strix Python locks contained known-vulnerable aiohttp==3.14.1 and cryptography==49.0.0.
  3. Coverage provisioning aborted on a protected-base pin for which a reachable index exposed no compatible binary, before testing the pull-request head that repaired that pin.
  4. Default-branch commits had no dependency snapshot, so dependency review could treat the full dependency graph as newly added on every pull request.
  5. Actionable review-repair dispatch ran every two hours, suppressed same-head retries for 24 hours, and resolved privileged scheduler code from mutable main instead of the reusable workflow's immutable source identity.

These changes are one atomic central baseline because every affected required gate and scheduler evaluates the same central repository state. The former stacked pull requests #736 and #745 were merged directly into this branch.

Changes

CodeQL consistency

  • Pin every github/codeql-action/init, analyze, and upload-sarif reference in the affected workflows to the same immutable v4.37.5 commit.
  • Preserve permissions, language detection, SARIF categories, upload behavior, and fail-closed processing.

A follow-up Dependabot update may advance the single shared immutable revision after this baseline lands; this pull request's invariant is that every affected CodeQL phase uses exactly one revision.

Strix dependency remediation

  • Replace aiohttp==3.14.1 with aiohttp==3.14.3.
  • Replace cryptography==49.0.0 with cryptography==50.0.0.
  • Add the explicit transitive floor aiohttp>=3.14.3 and regenerate the complete hash lock with the compatible pyOpenSSL release.

Bounded stale-pin recovery

  • Defer a failed protected-base pip preflight for binary unavailability only when pip emits both resolver diagnostics for the same exact requirement token and every comma-separated alternative is a conservatively recognized concrete PEP 440 version.
  • Preserve epoch, prerelease, postrelease, development, and local version forms used by pip.
  • Keep none, blank lists, arbitrary prose such as unavailable, mixed version/prose lists, single-sided or mismatched resolver diagnostics, empty output, unknown failures, hash mismatches, retries, connection failures, and Could not fetch URL fatal.
  • Give integrity, transport, and any unclassified ERROR: line precedence even when the same output also contains otherwise deferable evidence.
  • Retain bounded source-aware diagnostics and make the later networkless pull-request-head coverage run prove whether the skipped base lock was actually required.

Default-branch dependency snapshots

  • Run SBOM/dependency snapshot generation on pushes to main, master, and develop as well as pull requests and releases.
  • Bind push concurrency to github.sha, not a branch ref, so adjacent default-branch commits cannot cancel each other's snapshots.
  • Preserve closed-pull-request cancellation behavior and job-scoped contents: write only where dependency submission requires it.

Secure hourly review repair

  • Run PR Review Fix Scheduler at minute 23 of every hour.
  • Reduce the default same-head retry interval from 24 hours to 1 hour.
  • Retain one-dispatch-per-run and repository-scoped single-flight concurrency.
  • Resolve privileged scheduler source only from job.workflow_repository at immutable job.workflow_sha.
  • Retain canonical_ref only as an ignored deprecated compatibility input.
  • Keep contents-write and pull-requests-write permissions absent from the bounded repair scheduler.
  • Document the central MSA ownership, source-binding, permissions, cadence, and rollback boundary with current GitHub primary documentation.

TDD and verification contracts

The regression suite proves:

  • one CodeQL revision per affected workflow;
  • same-exact-requirement pairing plus a complete concrete PEP 440 alternative-version list for binary-unavailability deferral;
  • preservation of valid epoch/prerelease/postrelease/development/local alternatives;
  • fatal none, blank, arbitrary prose, mixed version/prose, single-sided, mismatched, integrity, transport, mixed-unknown, and otherwise unclassified failure handling;
  • behavioral propagation of fatal installer exits;
  • 100% statement/branch coverage and 100% production docstrings for the changed installer;
  • default-branch snapshot triggers, SHA-scoped concurrency, dependency submission, and closed-pull-request job conditions;
  • exact hourly cadence and one-hour same-head retry defaults;
  • one bounded repair dispatch per run;
  • immutable reusable-workflow source binding;
  • caller payloads, deprecated inputs, mutable refs, and the ordinary caller SHA cannot select privileged scheduler source; and
  • least-privilege scheduler permissions remain enforced.

Exact-current-head CodeQL, Python Security, Security Scan, Semgrep, OSV, Scorecard, Secret Scan, SBOM, OpenCode review, Noema review, unresolved-thread checks, and branch protection remain mandatory before merge.

Standards traceability

  • docs/automation/hourly-review-repair.md is the operator contract.
  • docs/doctoring/central-security-and-review-baseline.md records the design rationale, verification contract, MSA boundary, and APA 7th references to GitHub primary documentation, the final NIST SSDF 1.1 publication, the SSDF 1.2 initial public draft, and approved SLSA 1.2 specification.
  • Living GitHub documentation is cited as n.d. with a retrieval date under APA 7th edition.
  • The implementation follows those controls without claiming formal NIST or SLSA conformance.

Scope

Exactly thirteen files change:

  • .github/workflows/codeql-pr.yml
  • .github/workflows/pr-review-fix-scheduler.yml
  • .github/workflows/sbom-generation.yml
  • .github/workflows/scheduled-security-scan.yml
  • docs/automation/hourly-review-repair.md
  • docs/doctoring/central-security-and-review-baseline.md
  • requirements-strix-ci.txt
  • requirements-strix-ci-hashes.txt
  • scripts/ci/install_base_python_locks.py
  • tests/test_install_base_python_lock_missing_pin.py
  • tests/test_pr_review_fix_hourly_contract.py
  • tests/test_pr_review_fix_scheduler_source_pin.py
  • tests/test_sbom_generation_push_contract.py

No application code, repository-target authorization policy, review token permission, model budget, merge criterion, or vulnerability threshold is weakened. No branch-pushing or self-modifying one-shot workflow remains in the final tree.

Supersession

This atomic repair supersedes the relevant portions of closed #674, #704, #723, #727, #728, #729, #735 and the stacked/merged #736 and #745. Their unrelated changes remain excluded.

@seonghobae
seonghobae enabled auto-merge (squash) August 4, 2026 07:15

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please review exact head c73ee47861fca21e6959ce80fdf57b434c715c9d. Verify all six files as one atomic central-baseline repair: CodeQL version consistency and immutable pins, unchanged permissions/SARIF semantics, Strix lock advisory remediation, end-to-end stale-pin TDD boundary, fatal handling for none/blank/transport/hash/unknown failures, 100% coverage/docstrings, and all current-head security checks. Approve only if no blocking finding remains.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Please independently review exact head c73ee47861fca21e6959ce80fdf57b434c715c9d after current-head checks complete. Confirm the six-file atomic deadlock repair preserves fail-closed review/security boundaries and submit APPROVE only if no blocking finding remains.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a0713b9f-8eb0-4517-890c-b320bfba4309

📥 Commits

Reviewing files that changed from the base of the PR and between 3f65dbe and 32ac926.

📒 Files selected for processing (16)
  • .github/workflows/codeql-pr.yml
  • .github/workflows/pr-review-autofix.yml
  • .github/workflows/pr-review-fix-scheduler.yml
  • .github/workflows/sbom-generation.yml
  • .github/workflows/scheduled-security-scan.yml
  • docs/automation/hourly-review-repair.md
  • docs/doctoring/central-security-and-review-baseline.md
  • docs/doctoring/hourly-nvidia-nim-autofix.md
  • requirements-strix-ci-hashes.txt
  • requirements-strix-ci.txt
  • scripts/ci/install_base_python_locks.py
  • tests/test_install_base_python_lock_missing_pin.py
  • tests/test_pr_review_autofix_nvidia_nim_contract.py
  • tests/test_pr_review_fix_hourly_contract.py
  • tests/test_pr_review_fix_scheduler_source_pin.py
  • tests/test_sbom_generation_push_contract.py
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/strix-python-security-cves

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae
seonghobae marked this pull request as draft August 4, 2026 07:29
auto-merge was automatically disabled August 4, 2026 07:29

Pull request was converted to draft

@seonghobae
seonghobae marked this pull request as ready for review August 4, 2026 07:29

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the current head. All exact-head security, CodeQL, Semgrep, OSV, SBOM, Secret Scan, Scorecard, and Python Security workflows are green; this PR is intended to repair the protected baseline before dependent coverage and stale-pin PRs continue.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

@seonghobae I will review the current head and check the six-file atomic baseline repair.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@seonghobae
seonghobae marked this pull request as draft August 4, 2026 07:32
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae
seonghobae marked this pull request as ready for review August 4, 2026 07:32
@seonghobae
seonghobae enabled auto-merge (squash) August 4, 2026 07:33

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please review refreshed exact head 88a71a62274ea44be544cf190479fb13ccc4b62e. The final tree and six-file diff are unchanged; the head was refreshed solely to force source-repository ruleset workflow materialization. Verify all current-head checks, coverage/docstrings, CodeQL consistency, Strix lock remediation, and stale-pin fail-closed boundaries. Approve only if no blocker remains.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Please independently review refreshed exact head 88a71a62274ea44be544cf190479fb13ccc4b62e after current-head checks complete. The final tree is unchanged; confirm the atomic central baseline repair remains fail-closed and submit APPROVE only if no blocking finding remains.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please start a full current-head review now that the prior quota window has elapsed. Review exact head c73ee47861fca21e6959ce80fdf57b434c715c9d, not the earlier intermediate commit.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

@seonghobae I will perform a full review of the current head. I will review commit c73ee47861fca21e6959ce80fdf57b434c715c9d, not an earlier intermediate commit.

✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 38 minutes.

Copy link
Copy Markdown
Contributor Author

@copilot review the exact current head 88a71a62274ea44be544cf190479fb13ccc4b62e. Confirm that the final six-file tree preserves immutable CodeQL pins, clears the declared Strix dependency advisories, keeps unknown/index/network/hash failures fail-closed, and that the two temporary refresh commits leave no file-tree delta. Approve only if no actionable finding remains.

Copy link
Copy Markdown
Contributor Author

@opencode-agent @cwl-noema-review Current exact head is now 60f60095013341c7fec78f29a1e1eb83a7890141; all earlier-head verdict requests are superseded. CodeRabbit status and SBOM Generation already succeed on this head, while the remaining exact-head security workflows are running. After every exact-head check succeeds, perform independent final reviews of the complete 13-file atomic baseline and submit APPROVE only if no actionable blocker remains. Auto-merge is enabled but remains subject to branch protection and your current-head approvals.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please review exact current head 13c12cc4ea3368e24101ea968ae668bd9ea2fa25 now that CodeQL, Python Security, Security Scan, Semgrep, OSV, Scorecard, Secret Scan, and SBOM all succeeded. Verify the thirteen-file atomic central baseline, including 100% installer coverage/docstrings, Strix advisory remediation, immutable reusable-workflow source binding, hourly cadence, one-hour same-head retry, one-dispatch bound, dependency snapshots, and fail-closed stale-pin recovery. Submit APPROVE only if no blocker remains.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Please independently review exact current head 13c12cc4ea3368e24101ea968ae668bd9ea2fa25 after all current-head security checks succeeded. Confirm that the central baseline preserves least privilege, fail-closed review and security gates, immutable scheduler source binding, dependency snapshot semantics, and bounded hourly review repair. Submit APPROVE only if no blocking finding remains.

Copy link
Copy Markdown
Contributor Author

@opencode-agent @cwl-noema-review Exact head 60f60095013341c7fec78f29a1e1eb83a7890141 now has successful CodeQL PR, Python Security, Security Scan, SAST Semgrep, OSV-Scanner PR, Scorecard PR, Secret Scan, and SBOM Generation checks, plus successful CodeRabbit status and zero unresolved threads. Please submit independent final reviews on this exact head. Auto-merge is already enabled and must remain blocked unless current-head approval and branch protection are satisfied.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Exact current head is 60f60095013341c7fec78f29a1e1eb83a7890141 and all eight current-head workflows now succeed: CodeQL PR, Python Security, Security Scan, SAST Semgrep, OSV-Scanner PR, Scorecard PR, Secret Scan, and SBOM Generation. Please perform the final independent review of the complete thirteen-file atomic baseline and submit APPROVE only if no actionable blocker remains. Earlier-head requests and dismissed verdicts are superseded.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Exact current head is 60f60095013341c7fec78f29a1e1eb83a7890141; all current-head security, dependency, source-analysis, secret, and SBOM workflows succeed. Please independently verify least privilege, immutable reusable-workflow source binding, hourly one-dispatch review repair, stale-pin fail-closed behavior, dependency snapshot semantics, and the complete thirteen-file scope, then submit APPROVE only if no blocker remains.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

OpenCode reviewed the current-head bounded evidence and requested changes before merge.

Findings

1. P1 .github/workflows/pr-review-fix-scheduler.yml:97 - Immutable scheduler-source binding depends on unverified job.workflow_sha/job.workflow_repository context properties with a silent fail-open fallback

  • Problem: The checkout step selects the privileged scheduler code exclusively via repository: ${{ job.workflow_repository }} (line 96) and ref: ${{ job.workflow_sha }} (line 97). The trusted bounded evidence contains no official GitHub Actions contexts documentation citation and no OPENCODE_EXECUTION_RECEIPT establishing these properties or their runtime expansion; the documented reusable-workflow SHA properties live in the github context (github.workflow_sha / github.job_workflow_sha) with the called workflow's repository derivable from github.workflow_ref. If the properties expand to empty strings, actions/checkout silently resolves the caller's repository at the caller's ref, so the elevated-token dispatch path (PR_REVIEW_MERGE_TOKEN || OPENCODE_APPROVE_TOKEN) runs whatever scheduler code the caller checkout provides and the claimed immutable binding is void.
  • Root cause: The workflow comment asserts the 'job workflow context' exposes the called workflow's repository and immutable resolved SHA, but that runtime-support claim is not established by any trusted evidence in this run, and the only downstream check (python3 scripts/ci/pr_review_fix_scheduler.py --self-test) passes whenever the checked-out tree contains that script, so an empty or wrong source resolution is not detected and degrades fail-open instead of fail-closed.
  • Fix: Bind the ref to the documented github.workflow_sha (or github.job_workflow_sha) and derive the repository from github.workflow_ref; add a guard step that fails the job when the resolved repository or SHA is empty so an unset property cannot silently fall back to the caller; cite the official GitHub contexts documentation in docs/doctoring/central-security-and-review-baseline.md; verify with a real repository_dispatch run and capture the resolved checkout ref in the run log.
  • Regression test: Extend tests/test_pr_review_fix_scheduler_source_pin.py to assert the documented context expressions (github.workflow_sha / github.workflow_ref parsing) and an explicit empty-expansion guard step; run: python3 -m pytest tests
  • Suggested diff: posted in this finding's inline review thread.

Summary

Review of PR #731 (13 changed files: .github/workflows/codeql-pr.yml, .github/workflows/pr-review-fix-scheduler.yml, .github/workflows/sbom-generation.yml, .github/workflows/scheduled-security-scan.yml, docs/automation/hourly-review-repair.md, docs/doctoring/central-security-and-review-baseline.md, requirements-strix-ci-hashes.txt, requirements-strix-ci.txt, scripts/ci/install_base_python_locks.py, and 4 new test files) at head 60f6009. Approval sufficiency: insufficient; the scheduler immutable-source security claim is not affirmatively established. Verification posture: trusted current-head diffs and inlined hunks + Coverage execution evidence PASS; no OPENCODE_EXECUTION_RECEIPT exists for workflow runtime behavior. Linter/static: repo contracts list hadolint, npm audit, pip_audit, bandit, trivy; no failed-check log evidence present. TDD/regression: new contract tests added (test_pr_review_fix_scheduler_source_pin.py, test_pr_review_fix_hourly_contract.py, test_sbom_generation_push_contract.py, test_install_base_python_lock_missing_pin.py). Coverage: Coverage execution evidence PASS - supported repository test suites passed. Docstring coverage: same Coverage decision PASS - configured docstring gates passed or advisory. DAG: source-backed flowchart of scheduler checkout->self-test->dispatch and sbom push->SHA-bound concurrency (head flow). DDD/domain: no domain objects changed; CI control-plane workflows only. CDD/context: caller/callee reusable-workflow contract context preserved. Similar issues: file history shows this binding introduced by prior merged automation (#745); no unresolved peer threads at current head. Claim/concept check: the 'immutable resolved SHA' claim is not backed by official GitHub context documentation in trusted evidence. Standards search: no external standard material in changed files beyond GitHub Actions context semantics. Compatibility/convention: canonical_ref retained as deprecated ignored input default ''; actions/checkout bumped to pinned v7.0.1; CodeQL init/analyze uniformly pinned to v4.37.5 in codeql-pr.yml and scheduled-security-scan.yml; identifiers remain idiomatic multi-word. Breaking-change/backcompat: canonical_ref behavior change is intentional and documented in the input description. Implementation completeness: installer classifier (_is_deferable_preflight_failure/_contains_unclassified_error/_matching_binary_unavailability_requirements/_is_concrete_version_list) is concrete and fail-closed with paired exact-requirement plus concrete PEP 440 version evidence; no placeholder bodies. Performance: hourly cron with retry_hours 1 is bounded by MAX_DISPATCHES=1; SBOM concurrency bound to github.sha. Developer experience: scheduler self-test step retained; hourly-review-repair.md added. User experience: non-web surface - CI/review-gate behavior; cadence changes from every 2h to hourly with 1h retry. Visual/DOM: non-web; interaction surface is workflow/review-comment output. Accessibility/i18n: not applicable to CI workflows; docs in English. Supply-chain/license: Strix lock hash regeneration with aiohttp/cryptography remediation claimed; hash-vs-source consistency not independently readable this run. Packaging: pytest contract via 'python3 -m pytest tests'; no unpackaged source surfaces reported. Security/privacy: P1 blocker - elevated-token scheduler checkout must be proven bound to the called workflow SHA (documented github.workflow_sha / github.job_workflow_sha, repository from github.workflow_ref) or guarded to fail closed.

Adversarial validation

{"status":"failed","probes":[{"path":".github/workflows/pr-review-fix-scheduler.yml","line":97,"hypothesis":"The immutable-source binding fails: job.workflow_repository/job.workflow_sha are not established GitHub job-context properties, so actions/checkout silently falls back to the caller's repository/ref and the privileged scheduler code is not bound to the called workflow's immutable SHA.","attack_or_counterexample":"A caller repository invokes this reusable workflow with or without its own scripts/ci/pr_review_fix_scheduler.py; with empty repository/ref, checkout resolves the caller's repo at the caller's resolved ref instead of the called workflow's SHA, and the self-test passes whenever the checked-out tree happens to contain the script.","evidence":"Trusted current-head diff at .github/workflows/pr-review-fix-scheduler.yml:97 shows the sole source selector is 'ref: ${{ job.workflow_sha }}' (repository at line 96) and the only downstream check is 'python3 scripts/ci/pr_review_fix_scheduler.py --self-test', which cannot distinguish an org-repo checkout from the called-workflow SHA checkout; the trusted evidence packet contains no official GitHub contexts documentation citation and no OPENCODE_EXECUTION_RECEIPT proving runtime expansion of these properties, and tests/test_pr_review_fix_scheduler_source_pin.py only pins YAML text, so the fail-open fallback hypothesis could not be falsified. source-line-sha256=ca0dd4f50aeb6eeff442d99351a07457cfa2bc575dab845b4072f716f52c2388","outcome":"confirmed"},{"path":".github/workflows/sbom-generation.yml","line":45,"hypothesis":"The concurrency-group fallback change from github.ref to github.sha causes two adjacent default-branch pushes to cancel each other, leaving a base commit without a dependency snapshot.","attack_or_counterexample":"Two rapid pushes to main within one run window that would previously collapse to the same group via the github.ref fallback.","evidence":"Trusted current-head diff at .github/workflows/sbom-generation.yml:45 shows the fallback 'github.event.release.tag_name || github.sha', and tests/test_sbom_generation_push_contract.py::test_sbom_push_concurrency_is_bound_to_the_commit_sha asserts the group line contains 'github.event.release.tag_name || github.sha' and not 'github.ref'; the Coverage execution evidence records the supported repository test suites passed (python3 -m coverage run -m pytest tests, --fail-under=100), so distinct push SHAs map to distinct concurrency groups and the cancellation hypothesis is falsified. source-line-sha256=78732b9dfe98e936dfdcd60a246f4a8852d4b7f8d00eac8ab82e6f87ae5d374b","outcome":"falsified"}],"residual_risk":"Even with the SBOM push contract verified, the scheduler source-binding mechanism remains unverified against official GitHub context documentation and a live dispatch run; CodeQL upload-sarif step alignment and regenerated Strix hash correctness were not readable from trusted evidence in this run."}
  • Result: REQUEST_CHANGES

  • Reason: Blocking P1: the privileged scheduler checkout binds its immutable-source guarantee to job.workflow_repository/job.workflow_sha context properties whose existence and runtime expansion are not established by any trusted evidence in this run, and the unset-property failure mode is a silent fail-open fallback to the caller's repository/ref instead of a fail-closed error.

  • Head SHA: 60f60095013341c7fec78f29a1e1eb83a7890141

  • Workflow run: 30929181423

  • Workflow attempt: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (4 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow (4 files)"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Docs (2 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs (2 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["Changed file (2 files)"]
  S3 --> I3["repository behavior"]
  I3 --> R3["Review risk: Changed file (2 files)"]
  R3 --> V3["required checks"]
  Evidence --> S4["CI script: install_base_python_locks.py"]
  S4 --> I4["review and security gate shell path"]
  I4 --> R4["Review risk: CI script: install_base_python_locks.py"]
  R4 --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (4 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (4 files)"]
  R5 --> V5["targeted test run"]
Loading

Comment thread .github/workflows/pr-review-fix-scheduler.yml Outdated
@opencode-agent
opencode-agent Bot disabled auto-merge August 4, 2026 17:33

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please independently re-review exact current head e672f23d539114068ff74a7f190789217d15ef93. All eight direct current-head security workflows now succeed, the prior scheduler-source thread is resolved, and the fix keeps the officially documented job.workflow_* reusable-workflow identity while adding pre-checkout repository/path/SHA/ref validation and post-checkout SHA/file verification. Submit APPROVE only if no actionable blocker remains; do not reuse the prior-head CHANGES_REQUESTED verdict.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Please independently review exact current head e672f23d539114068ff74a7f190789217d15ef93. Verify the complete thirteen-file central baseline, especially fail-closed job.workflow_* source validation before checkout, post-checkout SHA/file verification, least privilege, hourly one-dispatch cadence, stale-pin classifier, dependency snapshots, APA 7 doctoring, and all current-head green checks. Submit APPROVE only if no blocker remains.

@seonghobae
seonghobae enabled auto-merge (squash) August 4, 2026 21:46
@seonghobae
seonghobae dismissed opencode-agent[bot]’s stale review August 4, 2026 21:47

Dismissed as stale after the reviewed head moved from 60f60095013341c7fec78f29a1e1eb83a7890141 to e672f23d539114068ff74a7f190789217d15ef93. The sole P1 finding was addressed with test-first pre-checkout validation of all documented job.workflow_* identity fields, validated-output checkout, post-checkout SHA/file verification, official GitHub contexts citation, and a resolved review thread. A new independent exact-head review has been requested and remains required before merge.

@opencode-agent
opencode-agent Bot disabled auto-merge August 4, 2026 21:48
@seonghobae
seonghobae marked this pull request as draft August 4, 2026 21:48
@seonghobae
seonghobae marked this pull request as ready for review August 4, 2026 21:49

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please perform one full substantive review of exact current head e672f23d539114068ff74a7f190789217d15ef93. All latest direct security workflows now succeed. Verify the thirteen-file atomic baseline, the resolved scheduler-source trust boundary, tests, doctoring references, and least-privilege permissions; do not reuse earlier-head findings.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/.github'
pr='731'
head='e672f23d539114068ff74a7f190789217d15ef93'

echo '== Exact pull request identity =='
printf 'checked_out_head='; git rev-parse HEAD
git cat-file -t "$head"
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head"
gh pr view "$pr" --repo "$repo" \
  --json state,headRefOid,baseRefOid,mergeable,reviewDecision,url \
  --jq '{state,headRefOid,baseRefOid,mergeable,reviewDecision,url}'

base="$(git merge-base "$head" origin/main)"
printf 'merge_base=%s\n' "$base"

echo '== Changed paths, scope, and whitespace =='
git diff --name-status "$base" "$head"
git diff --check "$base" "$head"
git diff --stat "$base" "$head"

echo '== Full diff of declared central-baseline files =='
git diff --unified=30 "$base" "$head" -- \
  .github/workflows/codeql-pr.yml \
  .github/workflows/pr-review-fix-scheduler.yml \
  .github/workflows/sbom-generation.yml \
  .github/workflows/scheduled-security-scan.yml \
  docs/automation/hourly-review-repair.md \
  docs/doctoring/central-security-and-review-baseline.md \
  requirements-strix-ci.txt \
  requirements-strix-ci-hashes.txt \
  scripts/ci/install_base_python_locks.py \
  tests/test_install_base_python_lock_missing_pin.py \
  tests/test_pr_review_fix_hourly_contract.py \
  tests/test_pr_review_fix_scheduler_source_pin.py \
  tests/test_sbom_generation_push_contract.py

echo '== Changed implementation and test structure =='
for path in \
  scripts/ci/install_base_python_locks.py \
  tests/test_install_base_python_lock_missing_pin.py \
  tests/test_pr_review_fix_hourly_contract.py \
  tests/test_pr_review_fix_scheduler_source_pin.py \
  tests/test_sbom_generation_push_contract.py
do
  echo "--- $path"
  ast-grep outline "$path" --items all
  cat -n "$path"
done

echo '== Changed workflows =='
for path in \
  .github/workflows/codeql-pr.yml \
  .github/workflows/pr-review-fix-scheduler.yml \
  .github/workflows/sbom-generation.yml \
  .github/workflows/scheduled-security-scan.yml
do
  echo "--- $path"
  cat -n "$path"
done

echo '== Security-sensitive workflow indicators =='
rg -n -C3 \
  'uses:\s*github/codeql-action/(init|analyze|upload-sarif)@|permissions:|contents:\s*write|pull-requests:\s*write|dependency-snapshot|job\.workflow_(repository|sha)|canonical_ref|cron:|github\.sha|git\s+push\b|gh\s+pr\s+merge\b|workflow_dispatch|pull_request_target|repository:|ref:|path:' \
  .github/workflows/codeql-pr.yml \
  .github/workflows/pr-review-fix-scheduler.yml \
  .github/workflows/sbom-generation.yml \
  .github/workflows/scheduled-security-scan.yml || true

echo '== Strix lock entries =='
rg -n -A30 -B4 '^(aiohttp|cryptography|pyopenssl)([<=>!~ ]|$)' \
  requirements-strix-ci.txt requirements-strix-ci-hashes.txt
rg -n '^(aiohttp==3\.14\.1|cryptography==49\.0\.0)\b' \
  requirements-strix-ci.txt requirements-strix-ci-hashes.txt || true

echo '== Changed documentation =='
cat -n docs/automation/hourly-review-repair.md
cat -n docs/doctoring/central-security-and-review-baseline.md

echo '== Exact-head check runs =='
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name,.status,(.conclusion // "null"),.details_url] | `@tsv`' \
  | sort -u

echo '== Exact-head incomplete or unsuccessful check runs =='
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
  --jq '.check_runs[]
    | select(.status != "completed" or (.conclusion != "success" and .conclusion != "neutral" and .conclusion != "skipped"))
    | [.name,.status,(.conclusion // "null"),.details_url] | `@tsv`' \
  | sort -u

echo '== Exact-head legacy statuses =='
gh api "repos/$repo/commits/$head/status" \
  --jq '.statuses[] | [.context,.state,.target_url] | `@tsv`' | sort -u

echo '== Unresolved review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='.github' -F number="$pr" -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) { nodes { isResolved } }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)] | length'

Length of output: 245031


@seonghobae I completed a full review of exact head e672f23d539114068ff74a7f190789217d15ef93.

I found no actionable finding.

The review verified these items:

  • The diff changes exactly 13 files. git diff --check reports no whitespace errors.
  • All changed CodeQL init, analyze, and upload-sarif references use immutable revision d1ba80a13dd99fba24a470575428917156a28b43 (v4.37.5).
  • CodeQL permissions and local Medium+ SARIF gate behavior remain unchanged.
  • The Strix requirements use aiohttp>=3.14.3, aiohttp==3.14.3 in the hash lock, cryptography==50.0.0, and pyopenssl==26.4.0. The replaced vulnerable pins are absent.
  • The stale-pin classifier accepts only paired diagnostics for the same normalized requirement with complete concrete PEP 440 alternative lists. It fails closed for empty, prose, mixed, mismatched, single-sided, integrity, transport, and unclassified failures.
  • The regression tests cover valid epoch, prerelease, postrelease, development, and local versions. They also cover fatal counterexamples and installer exit propagation.
  • The SBOM workflow runs on main, master, and develop pushes. Push concurrency uses github.sha. The dependency snapshot has job-scoped contents: write.
  • The scheduler validates job.workflow_repository, job.workflow_sha, job.workflow_ref, and job.workflow_file_path before checkout. It checks out only the validated SHA. It then verifies the checked-out SHA and the regular, non-symlink workflow file before it can use the dispatch credential.
  • canonical_ref remains declared only for compatibility. It cannot select scheduler source.
  • The scheduler runs hourly at minute 23. It keeps the one-hour retry floor, one-dispatch default, repository-scoped concurrency, and no contents: write or pull-requests: write permission.
  • The two doctoring documents describe the source-binding and least-privilege boundary. They include the stated GitHub, NIST, and SLSA references.
  • The exact head has successful coverage, CodeQL, dependency, security, SBOM, and review checks. The cancelled duplicate check executions have successful or skipped later executions on this same head.
  • The pull request has zero unresolved review threads.

The current-head evidence supports merge subject to repository branch protection.

You are interacting with an AI system.

@seonghobae
seonghobae enabled auto-merge (squash) August 4, 2026 22:01
@seonghobae
seonghobae marked this pull request as draft August 4, 2026 22:05
auto-merge was automatically disabled August 4, 2026 22:05

Pull request was converted to draft

@seonghobae
seonghobae marked this pull request as ready for review August 4, 2026 22:05
* test(ci): require hourly NVIDIA NIM review autofix

* test(ci): cover both NVIDIA NIM autofix executions

* chore(ci): add deterministic NVIDIA NIM autofix patcher

* ci: validate and apply NVIDIA NIM autofix migration

* docs(doctoring): define NVIDIA NIM autofix boundary

* ci: verify and apply NVIDIA NIM autofix migration

* ci: retrigger validated NVIDIA NIM migration

* fix(ci): keep secret expressions literal in one-shot patch

* fix(ci): route scheduled autofix through NVIDIA NIM

* chore(ci): remove failed one-shot migration helper

* chore(ci): remove superseded PR 752 patch script

* chore(ci): remove superseded PR 752 patch workflow

* test(ci): require fail-closed NVIDIA NIM secret handling

* test(ci): harden NVIDIA NIM autofix trust boundary

* chore(ci): apply reviewed NVIDIA autofix hardening

* chore(ci): remove unused NVIDIA autofix patch workflow

* fix(ci): harden NVIDIA NIM autofix trust boundary

* docs(ci): record NVIDIA autofix trust-boundary hardening

* test(ci): isolate GitHub credentials from OpenCode subprocesses

* ci: apply reviewed NVIDIA NIM credential isolation

* ci: repair deterministic credential-isolation patch

* test(ci): pin independent reviewer workflow unchanged

* ci: rerun credential isolation after reviewer pin fix

* ci: publish credential isolation with workflow-capable token

* ci: publish credential isolation with OpenCode App token

* fix(ci): isolate OpenCode from GitHub credentials

* ci: remove credential-isolation patch workflow

* docs(doctoring): record OpenCode credential isolation boundary

* ci: dispatch exact-head review for central baseline

* ci: remove exact-head review dispatcher

---------

Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #757. The central review/security baseline from this branch was integrated into #757 together with the trusted agent-mention control plane, and subsequent exact-head fixes continue in #759. Keeping this historical branch open would duplicate checks and approvals against an older head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant